package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/3
 **/
public class SortSting {
    public static void main(String[] args) {
        List<String> lise = new ArrayList<>();
        lise.add("jack");
        lise.add("rose");
        lise.add("tom");
        lise.add("jerry");
        lise.add("black");
        lise.add("Kobe");
        System.out.println(lise);
        Collections.sort(lise);
        System.out.println(lise);
        List<String> a = new ArrayList<>();
        a.add("王克晶");
        a.add("范创奇哥");
        a.add("老苍");
        Collections.sort(a, (o1, o2) -> o2.length() - o1.length());
        System.out.println(a);


    }
}
